holybible.view.HolyBibleView = holybible.view.View.extend({
	init: function() {
		this._super();
		this.headerView = new holybible.view.HeaderView();
		this.footerView = new holybible.view.FooterView();
		this.menuView = new holybible.view.MenuView();

		this.bibleListView = new holybible.view.BibleListView();
		this.bookListView = new holybible.view.BookListView();
		this.chapterListView = new holybible.view.ChapterListView();
		this.versesView = new holybible.view.VersesView();
		
		this.currentView = null;
	},
	draw: function() {
		this._super();
		this.headerView.show();
		this.footerView.show();
	},
	setTitle: function(title) {
		this.headerView.setTitle(title);
	},
	hideCurrentView: function() {
		if (this.currentView) {
			this.currentView.hide();
		}
	},
	showBibleListView: function() {
		this.hideCurrentView();
		this.currentView = this.bibleListView;
		this.bibleListView.show();
		this.headerView.setTitle();
		this.footerView.hideNavigation();
	},
	showBookListView: function(params) {
		var vcode = params.vcode || null;
		if (!vcode) {
			return;
		}
		this.hideCurrentView();
		this.currentView = this.bookListView;
		this.bookListView.show(params);
		this.headerView.setTitle(vcode);
		this.footerView.hideNavigation();
	},
	showChapterListView: function(params) {
		var vcode = params.vcode || null;
		var bcode = params.bcode || null;
		if (!vcode || !bcode) {
			return;
		}
		this.hideCurrentView();
		this.currentView = this.chapterListView;
		this.chapterListView.show(params);
		this.headerView.setTitle(vcode, bcode);
		this.footerView.hideNavigation();
	},
	showVerses: function(params) {
		var vcode = params.vcode || null;
		var bcode = params.bcode || null;
		var cnum = params.cnum || null;
		if (!vcode || !bcode || !cnum) {
			return;
		}
		this.hideCurrentView();
		this.currentView = this.versesView;
		this.versesView.show(params);
		this.headerView.setTitle(vcode, bcode, cnum);
		this.footerView.showNavigation(vcode, bcode, cnum);
	}
	
});
